package zone

const (
	OpSync          int32 = iota // 同步请求
	OpFetch                      // 获取zonefile请求
	OpLeave                      // 移除zone请求
	OpGetContainers              // 获取 Moon 上所有 container 的请求
)

type ZoneMoonState int

const (
	// 创建后的初始状态
	ZoneMoonCreated ZoneMoonState = iota

	// zonefile已同步，等待部署
	ZoneMoonSynced

	// zone部署完毕
	ZoneMoonDeployed

	// 部署出错时设置
	ZoneMoonError
)

func (s ZoneMoonState) String() string {
	switch s {
	case ZoneMoonSynced:
		return "ZoneMoonSynced"
	case ZoneMoonCreated:
		return "ZoneMoonCreated"
	case ZoneMoonDeployed:
		return "ZoneMoonDeployed"
	case ZoneMoonError:
		return "ZoneMoonError"
	default:
		return "Unknown"
	}
}
